<%@page pageEncoding="UTF-8" %>
<!doctype html>
<html lang="zh-cmn">
<head>
    <%@include file="/WEB-INF/pagers/header.jsp"%>
</head>
<body class="bg-white">
    <div class="container-fluid">
        <div id="toolbar">
            <button type="button" class="btn btn-success"><i class="glyphicon glyphicon-plus-sign"></i>添加角色</button>
        </div>
        <table data-toggle="table"
        data-url="${ctx}/sys/role/list"
        data-toolbar="#toolbar"
        data-toolbar-align="right"
        data-detail-view="true"
        data-detail-formatter="getDetail">
            <thead>
            <tr>
                <th data-radio="true"></th>
                <th data-field="id">编号</th>
                <th data-field="name">角色名称</th>
                <th data-field="modifyBy">修改人</th>
                <th data-field="modifyTime">修改时间</th>
                <th data-field="state">状态</th>
                <th>操作</th>
            </tr>
            </thead>
        </table>
    </div>

<%@include file="/WEB-INF/pagers/footer.jsp"%>
<script>
    function getDetail(index,row) {
        var roleId = row.id;
        var html = "";
        $.ajax({

            url:ctx+"/sys/role/searchByRole",
            data:"roleId"+roleId,
            dataType:"json",
            async:false,
            success:function (arr) {
                $(arr).each(function () {
                    var str = "<p>"+this.username+": "+this.note+"</p>";
                    html+=str;
                    alert(html);
                });

            },
            error:function () {
                alert("dsdfd");
            }
        });

        return html;


    }
</script>
</body>
</html>
